//
//  ZRStatusModel.swift
//  Sina
//
//  Created by 张锐 on 16/3/1.
//  Copyright © 2016年 zhangr. All rights reserved.
//

import UIKit

class ZRStatusModel: NSObject {
    //微博ID用来上拉加载更多
    var id : Int = 0
    /// 创建时间
    var created_at : String?
    /// 微博内容
    var text : String?
    /// 来源
    var source : String?
    /// 用户信息
    var user : ZRStatusUserModel?
    /// 转发微博信息
    var retweeted_status : ZRStatusModel?
    /// 转发数
    var reposts_count : Int = 0
    /// 评论数
    var comments_count : Int = 0
    /// 赞数
    var attitudes_count : Int = 0

    var pic_urls : [ZRPicModel]?
    
    init(dic : [String : NSObject]) {
        super.init()
        
        setValuesForKeysWithDictionary(dic)
        
        if let userDic = dic["user"] as?[String : NSObject]{
            
            user = ZRStatusUserModel(dic: userDic)
        }
        if let retweetDic = dic["retweeted_status"] as?[String : NSObject]{
            
            retweeted_status = ZRStatusModel(dic: retweetDic)
        }
        if let pic_Urls = dic["pic_urls"] as? [[String:NSObject]]{
        
            pic_urls = [ZRPicModel]()
            
            for picdata in pic_Urls{
            
                let picm = ZRPicModel(Dic: picdata)
                
                pic_urls?.append(picm)
            
            }
        
        }
    
    }
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {
        
    }
    
    
    

}
